package com.chen.product.controller;

import com.chen.model.entity.product.Brand;
import com.chen.model.vo.common.Result;
import com.chen.model.vo.common.ResultCodeEnum;
import com.chen.product.service.BrandService;
import org.apache.poi.util.Removal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cgj
 * @date 4/14/25 8:44 PM
 */
@RestController
@RequestMapping("/api/product/brand")
//  http://localhost:8500/api/product/brand/findAll
public class BrandController {
    @Autowired
    private BrandService brandService;

    /**
     * 查询全部品牌
     * @return
     */
    @GetMapping("/findAll")
    public Result<List<Brand>> findAll(){
        List<Brand> brandList=brandService.findAll();
        return Result.build(brandList, ResultCodeEnum.SUCCESS);
    }
}
